<!DOCTYPE html>
<html>
<head>
<style>
  .fixed {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: silver;
  }
  ::-webkit-scrollbar {
    width: 0px;
    height: 0px;
  }
</style>
<script>
  if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
  }
  if (window.internals && window.eventSender) {
    internals.settings.setPreferCompositingToLCDTextEnabled(true);
    internals.setPageScaleFactorLimits(0.5, 4);

    addEventListener("load", function() {
      window.scrollTo(100,100);

      document.getElementById("layerTree").innerText = internals.layerTreeAsText(document);

      internals.setPageScaleFactor(0.5);
      setTimeout(function() {
        document.getElementById("layerTreeScaledDown").innerText = internals.layerTreeAsText(document);

        internals.setPageScaleFactor(1.5);
        setTimeout(function() {
          document.getElementById("layerTreeScaledUp").innerText = internals.layerTreeAsText(document);
          testRunner.notifyDone();
        }, 0);
      }, 0);
    }, false);
  }
</script>
</head>

<!-- Fixed position elements may skip compositing without a scrollable
ancestor. To make sure this test covers the intended scenario, we force the
body element to be tall, so that the FrameView is scrolling. -->
<body style="width: 4000px; height: 4000px;">
<div style="height: 1000px">
  Not scaled:
  <pre id="layerTree"></pre>
  Scale=0.5:
  <pre id="layerTreeScaledDown"></pre>
  Scale=1.5:
  <pre id="layerTreeScaledUp"></pre>
</div>
<!-- The layer tree should always be the same, regardless of page scale, except on platforms that enable the applyPageScaleFactorInCompositor Setting. -->
<!-- No layer in any case. -->
<div class="fixed" style="top: -100px"></div>
<!-- When applyPageScaleFactorInCompositor is true, this will have composited layer when scaled down; no layer when not scaled or scaled up. -->
<div class="fixed"></div>
<div class="fixed" style="top: 0px; left: 1000px"></div>
<!-- When applyPageScaleFactorInCompositor is true, this will have composited layer when not scaled and scaled down; no layer scaled up. -->
<div class="fixed" style="top: 0px; left: 600px"></div>
<!-- Always has composited layer. -->
<div class="fixed" style="top: 0px; left: 0px"></div>
</body>
</html>
